<?php
	$param=$_GET['consulta'];
	$con = mysql_connect("localhost","root","diego161");
	if (!$con){
		die('Could not connect: ' . mysql_error());
	}
	else{
		$db_selected = mysql_select_db("Diegol", $con);
		if(!$db_selected){
			die ('Can\'t use Diegol : ' . mysql_error());
		}
		else{
			$result = mysql_query("Select nombre from Datos_Series where nombre = '.$param.' OR Match(nombre) against('.$param.' IN BOOLEAN MODE)");
			while($row = mysql_fetch_array($result)){
				$final .= "<p class='result'>" .$row['nombre']. "</p>";
			}
		}
		echo json_encode($final);
	}  
	mysql_close($con);
?>

